// 获取用户信息
$(function () {
  $.ajax({
    method: "POST",
    url: "index/profile",
    headers: {
      "x-token":
        "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaW5mbyI6eyJpZCI6IjEiLCJsb2dpbl9uYW1lIjoiYWRtaW4iLCJwYXNzd29yZCI6Ijk2ZTc5MjE4OTY1ZWI3MmM5MmE1NDlkZDVhMzMwMTEyIiwibmFtZSI6IlRoaW5rSlPkuIDlk6UiLCJlbWFpbCI6Imhld3UxMTIyQDE2My5jb20iLCJwaG9uZSI6IjE3MzQyMDY1OTA5IiwibG9naW5faXAiOiI6OjEiLCJsb2dpbl9kYXRlIjoiMjAxOC0wMS0wOCAxNjoyMjo1MSIsImNyZWF0ZV9kYXRlIjoiMjAxNy0xMi0xNCAxMTo1Mjo0NiIsInVwZGF0ZV9kYXRlIjoiMjAyMy0wMi0wNCAyMjoyOTo0OCIsImRlbF9mbGFnIjoiMCIsInJvbGVfaWQiOlsiMWM1NGUwMDNjMWZjNGRjZDliMDg3ZWY4ZDQ4YWJhYzMiLCJhNzhiNWJkMC0zYzQ5LTExZWMtYWJkYy03YmE4MWNmNmM1ZWYiXSwic3RhdHVzIjowLCJkZWZhdWx0X2RhdGEiOiIxIiwicm9sZW5hbWUiOlsi6LaF57qn566h55CG5ZGYIiwi6JCl6ZSA5Li7566hIl19LCJpYXQiOjE2NzU1NjExOTB9.DPDgI_1eodRnf7Q0BovDUKtexZEtR5v4NYv06jSb34M",
    },
    success: function (res) {
      console.log(res);
      let data = {
        name: res.data.userInfo.name,
      };
      let htmlStr = template("welcome1", data);
      $(".userinfo").html(htmlStr);
    },
  });
});
